home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-13 | 30.5 KB | 1,142 lines | [TEXT/MPS ] |
- ; Version: 2.56
- ; Created: Tuesday, September 12, 1989 at 8:06:46 PM
- ;
- ; File ScriptEqu.a
- ;
- ; Assembler Interface to the Macintosh Libraries
- ; Copyright Apple Computer, Inc. 1986-1989
- ; All Rights Reserved
- ;
- ; -----------------------------------------------------------------------------
- ; Script Manager equates file.
- ;
- ; This file contains all equates for the script environment, shared
- ; equates for the script interface systems, equates that are special for
- ; the Roman Interface System, and all equates for the script interface
- ; system package.
- ; -----------------------------------------------------------------------------
-
- ; Note that the version number is divided into two bytes: The high byte is
- ; bumped when the changes make the next version incompatible with previous
- ; versions. If compatibility is maintained, the low byte is bumped. The low
- ; byte is maintained privately by the Script Manager, and is shown as 0 here.
-
- smgrVers EQU $0200 ; current version number.
-
- ; -----------------------------------------------------------------------------
- ; Constants for the Script Manager trap call, _ScriptUtil.
- ; -----------------------------------------------------------------------------
-
- ; Script Interface System numbers.
-
- smRoman EQU 0 ; Font script is Roman.
- smJapanese EQU 1 ; Font script is Japanese.
- smChinese EQU 2 ; Font script is Chinese.
- smKorean EQU 3 ; Font script is Korean.
- smArabic EQU 4 ; Font script is Arabic.
- smHebrew EQU 5 ; Font script is Hebrew.
- smGreek EQU 6 ; Font script is Greek.
- smRussian EQU 7 ; Font script is Russian.
- smRSymbol EQU 8 ; Font script is Right-left symbol.
- smDevanagari EQU 9 ; Font script is Devanagari.
- smGurmukhi EQU 10 ; Font script is Gurmukhi.
- smGujarati EQU 11 ; Font script is Gujarati.
- smOriya EQU 12 ; Font script is Oriya.
- smBengali EQU 13 ; Font script is Bengali.
- smTamil EQU 14 ; Font script is Tamil.
- smTelugu EQU 15 ; Font script is Telugu.
- smKannada EQU 16 ; Font script is Kannada.
- smMalayalam EQU 17 ; Font script is Malayalam.
- smSinhalese EQU 18 ; Font script is Sinhalese.
- smBurmese EQU 19 ; Font script is Burmese.
- smKhmer EQU 20 ; Font script is Khmer.
- smThai EQU 21 ; Font script is Thai.
- smLaotian EQU 22 ; Font script is Laotian.
- smGeorgian EQU 23 ; Font script is Georgian.
- smArmenian EQU 24 ; Font script is Armenian.
- smMaldivian EQU 25 ; Font script is Maldivian.
- smTibetan EQU 26 ; Font script is Tibetan.
- smMongolian EQU 27 ; Font script is Mongolian.
- smAmharic EQU 28 ; Font script is Amharic.
- smGeez EQU 28 ; Font script is Amharic.
- smSlavic EQU 29 ; Font script is Slavic.
- smVietnamese EQU 30 ; Font script is Vietnamese.
- smSindhi EQU 31 ; Font script is Sindhi.
- smUninterp EQU 32 ; Font script is uninterpreted Symbols.
-
- ; Language Codes
-
- langEnglish EQU 0
- langFrench EQU 1
- langGerman EQU 2
- langItalian EQU 3
- langDutch EQU 4
- langSwedish EQU 5
- langSpanish EQU 6
- langDanish EQU 7
- langPortugese EQU 8
- langNorwegian EQU 9
- langHebrew EQU 10
- langJapanese EQU 11
- langArabic EQU 12
- langFinnish EQU 13
- langGreek EQU 14
- langIcelandic EQU 15
- langMalta EQU 16
- langTurkish EQU 17
- langYugoslavian EQU 18
- langChinese EQU 19
- langUrdu EQU 20
- langHindi EQU 21
- langThai EQU 22
-
- ; Calendar Codes
-
- calGregorian EQU 0
- calArabicCivil EQU 1
- calArabicLunar EQU 2
- calJapanese EQU 3
- calJewish EQU 4
- calCoptic EQU 5
-
- ; Integer Format Codes
-
- intWestern EQU 0
- intArabic EQU 1
- intRoman EQU 2
- intJapanese EQU 3
- intEuropean EQU 4
- intOutputMask EQU $8000
-
- ; CharByte byte types.
-
- smSingleByte EQU 0
- smFirstByte EQU -1
- smLastByte EQU 1
- smMiddleByte EQU 2
-
- ; CharType field masks
-
- smcTypeMask EQU $000F
- smcReserved EQU $00F0
- smcClassMask EQU $0F00
- smcReserved12 EQU $1000
- smcRightMask EQU $2000
- smcUpperMask EQU $4000
- smcDoubleMask EQU $8000
-
- ; CharType character types.
-
- smCharPunct EQU 0
- smCharAscii EQU 1
- smCharEuro EQU 7
- smCharFISKana EQU 2 ; Katakana
- smCharFISGana EQU 3 ; Hiragana
- smCharFISIdeo EQU 4 ; Hanzi, Kanji, Hanja
- smCharFISGreek EQU 5 ; Greek (2-byte)
- smCharFISRussian EQU 6 ; Russian/Cyrillic (2-byte)
- smCharFISHangul EQU 8 ; Hangul (**tentative**)
-
- ; CharType classes (smCharPunct sub-types).
- smPunctNormal EQU $0000
- smPunctNumber EQU $0100
- smPunctSymbol EQU $0200
- smPunctBlank EQU $0300 ; NBSP is PunctNormal
-
- ; CharType classes (smCharFISIdeo sub-types).
-
- smFISClassLvl1 EQU $0000 ; level 1 char
- smFISClassLvl2 EQU $0100 ; level 2 char
- smFISClassUser EQU $0200 ; user char
-
- ; CharType directions
-
- smCharLeft EQU $0000
- smCharRight EQU $2000
-
- ; CharType case modifers.
-
- smCharLower EQU $0000
- smCharUpper EQU $4000
-
- ; CharType character size modifiers (1 or multiple bytes).
-
- smChar1byte EQU $0000
- smChar2byte EQU $8000
-
- ; Char2Pixel directions.
-
- smLeftCaret EQU 0 ; Place caret for left block.
- smRightCaret EQU -1 ; Place caret for right block.
- smHilite EQU 1 ; Direction is TESysJust.
-
- ; Transliterate target types for Roman script.
-
- smTransAscii EQU 0 ; convert to ASCII
- smTransNative EQU 1 ; convert to native script
- smTransCase EQU $FE ; convert case for all text
- smTransSystem EQU $FF ; convert to system script
-
- ; Transliterate target types for FIS
-
- smTransAscii1 EQU 2 ; 1-byte Roman
- smTransAscii2 EQU 3 ; 2-byte Roman
- smTransKana1 EQU 4 ; 1-byte Katakana
- smTransKana2 EQU 5 ; 2-byte Katakana
- ; (no 1-byte hiragana)
- smTransGana2 EQU 7 ; 2-byte Hiragana
-
- ; Transliterate target modifiers.
-
- smTransLower EQU $4000
- smTransUpper EQU $8000
-
- ; Transliterate source mask - general.
-
- smMaskAll EQU $FFFFFFFF ; Convert all text
-
- ; Transliterate source masks for Roman system.
-
- smMaskAscii EQU 1 ; 2^smTransAscii
- smMaskNative EQU $00000002 ; 2^smTransNative
-
- ; Transliterate source masks for FIS.
-
- smMaskAscii1 EQU $00000004 ; 2^smTransAscii1
- smMaskAscii2 EQU $00000008 ; 2^smTransAscii2
- smMaskKana1 EQU $00000010 ; 2^smTransKana1
- smMaskKana2 EQU $00000020 ; 2^smTransKana2
- smMaskGana2 EQU $00000080 ; 2^smTransGana2
-
- ; Result values from GetEnvirons, SetEnvirons, GetScript and SetScript calls.
-
- smNotInstalled EQU 0 ; routine not available in script
- smBadVerb EQU -1 ; Bad verb passed to a routine.
- smBadScript EQU -2 ; Bad script code passed to a routine.
-
- ; Result values from StyledLineBreak
-
- smBreakWord EQU 0 ; could break at word boundary
- smBreakChar EQU 1 ; had to break at char boundary
- smBreakOverflow EQU 2 ; text too short, width subtracted
-
- ; -----------------------------------------------------------------------------
- ; GetEnvirons and SetEnvirons verbs.
- ; -----------------------------------------------------------------------------
-
- smVersion EQU 0 ; Environment version number.
- smMunged EQU 2 ; Globals change count.
- smEnabled EQU 4 ; Environment enabled flag.
- smBidirect EQU 6 ; One bidirectional script.
- smFontForce EQU 8 ; Force font flag.
- smIntlForce EQU 10 ; Force intl flag.
- smForced EQU 12 ; forced to system script.
- smDefault EQU 14 ; defaulted to Roman script.
- smPrint EQU 16 ; Printer action routine.
- smSysScript EQU 18 ; System script.
- smLastScript EQU 20 ; Last keyboard script.
- smKeyScript EQU 22 ; Keyboard script.
- smSysRef EQU 24 ; System folder refNum.
- smKeyCache EQU 26 ; Keyboard table cache pointer.
- smKeySwap EQU 28 ; Swapping table pointer.
- smGenFlags EQU 30 ; general flags long
- smOverride EQU 32 ; script override flags
- smCharPortion EQU 34 ; Ch vs SpExtra proportion
- smLastEVerb EQU smCharPortion ; Last environment verb.
-
- ; GetScript and SetScript verbs.
- ; Note: verbs private to script systems are negative, while
- ; those general across script systems are non-negative
-
- smScriptVersion EQU 0 ; Script software version.
- smScriptMunged EQU 2 ; Script entry changed count.
- smScriptEnabled EQU 4 ; Script enabled flag.
- smScriptRight EQU 6 ; Right to left flag.
- smScriptJust EQU 8 ; Justification flag.
- smScriptRedraw EQU 10 ; Word redraw flag.
- smScriptSysFond EQU 12 ; Preferred system font.
- smScriptAppFond EQU 14 ; Preferred Application font.
- smScriptBundle EQU 16 ; Beginning of dictionary verbs.
- smScriptNumber EQU 16 ; Script itl0 id, from dictionary.
- smScriptDate EQU 18 ; Script itl1 id, from dictionary.
- smScriptSort EQU 20 ; Script itl2 id, from dictionary.
- smScriptFlags EQU 22 ; flags word
- smScriptToken EQU 24 ; Script itl3 id, from dictionary.
- smScriptRsvd3 EQU 26 ; reserved.
- smScriptLang EQU 28 ; Current language for script
- smScriptNumDate EQU 30 ; Script Number/Date formats
- smScriptKeys EQU 32 ; Script KEYC id.
- smScriptIcon EQU 34 ; Script SICN id.
- smScriptPrint EQU 36 ; Script printer action routine.
- smScriptTrap EQU 38 ; Trap entry pointer.
- smScriptCreator EQU 40 ; Script file creator.
- smScriptFile EQU 42 ; Script file name.
- smScriptName EQU 44 ; Script name.
- smLastSVerb EQU smScriptName ; Last script verb.
-
- ; -----------------------------------------------------------------------------
- ; Bits in the smScriptFlags word (bits above 7 are non-static)
- ; -----------------------------------------------------------------------------
-
- smsfIntellCP EQU 0 ; script has intellegent cut & paste
- smsfSingByte EQU 1 ; script has only single bytes
- smsfNatCase EQU 2 ; native chars have upper & lower case
- smsfContext EQU 3 ; contextual script (e.g. AIS-based)
- smsfNoForceFont EQU 4 ; will not force characters
- smsfB0Digits EQU 5 ; has alternate digits at B0-B9
- smsfForms EQU 13 ; uses contextual forms for letters
- smsfLigatures EQU 14 ; uses contextual ligatures
- smsfReverse EQU 15 ; reverses native text, right-left
-
- ; Bits in the smGenFlags long. First byte is set from itlc flags byte
- smfShowIcon EQU 31 ; show icon even if only one script
- smfDualCaret EQU 30 ; use dual caret for mixed direction text
-
- ; Roman script constants.
-
- romanVers EQU $0101 ; version number.
- romanSysFond EQU $3FFF ; system font id number.
- romanAppFond EQU 3 ; application font id number.
- romanFlags EQU 1<<smsfIntellCP++1<<smsfSingByte++1<<smsfNatCase
- ; roman settings
-
- ; Script Manager font equates.
-
- smFondStart EQU $4000 ; start from 16K.
- smFondEnd EQU $C000 ; past end of range at 48K.
-
- ; Macintosh character set extensions
-
- diaeresisUprY EQU $D9 ; Ÿ
- fraction EQU $DA ; ⁄
- intlCurrency EQU $DB ; €
- leftSingGuillemet EQU $DC ; ‹
- rightSingGuillemet EQU $DD ;
- fiLigature EQU $DE ; fi
- flLigature EQU $DF ; fl
- dblDagger EQU $E0 ; ‡
- centeredDot EQU $E1 ; ·
- baseSingQuote EQU $E2 ; ‚
- baseDblQuote EQU $E3 ; „
- perThousand EQU $E4 ; ‰
- circumflexUprA EQU $E5 ; Â
- circumflexUprE EQU $E6 ; Ê
- acuteUprA EQU $E7 ; Á
- diaeresisUprE EQU $E8 ; Ë
- graveUprE EQU $E9 ; È
- acuteUprI EQU $EA ; Í
- circumflexUprI EQU $EB ; Î
- diaeresisUprI EQU $EC ; Ï
- graveUprI EQU $ED ; Ì
- acuteUprO EQU $EE ; Ó
- circumflexUprO EQU $EF ; Ô
- appleLogo EQU $F0 ;
- graveUprO EQU $F1 ; Ò
- acuteUprU EQU $F2 ; Ú
- circumflexUprU EQU $F3 ; Û
- graveUprU EQU $F4 ; Ù
- dotlessLwrI EQU $F5 ; ı
- circumflex EQU $F6 ; ˆ
- tilde EQU $F7 ; ˜
- macron EQU $F8 ; ¯
- breve EQU $F9 ; ˘
- overDot EQU $FA ; ˙
- ring EQU $FB ; ˚
- cedilla EQU $FC ; ¸
- doubleAcute EQU $FD ; ˝
- ogonek EQU $FE ; ˛
- hachek EQU $FF ; (not shown)
-
- ; -----------------------------------------------------------------------------
- ; Bundle declarations
- ; -----------------------------------------------------------------------------
- ; Record declaration for international configuration resource (type itlc).
-
- ItlcRecord record 0
- itlcSystem ds.w 1 ; default system script.
- itlcReserved ds.w 1 ; reserved
- itlcFontForce ds.b 1 ; default font force flag.
- itlcIntlForce ds.b 1 ; default intl force flag.
- itlcOldKybd ds.b 1 ; old keyboard
- itlcFlags ds.b 1 ; general flags
- itlcIconOffset ds.w 1 ; script icon offset
- itlcIconSide ds.b 1 ; icon side (R=0,L=$FF)
- itlcIconRsvd ds.b 1 ; rsvd for other icon info
- itlcReserved2 ds.b 36 ; for future use
- itlcSize equ * ; size of script itlc.
- endr
-
- ; Record declaration for international bundle resource (type itlb).
-
- ItlbRecord record 0
- itlbNumber ds.w 1 ; ITL0 id number.
- itlbDate ds.w 1 ; ITL1 id number.
- itlbSort ds.w 1 ; ITL2 id number.
- itlbFlags ds.w 1 ; Script Flags.
- itlbToken ds.w 1 ; ITL4 id number.
- itlbReserved3 ds.w 1 ; reserved.
- itlbLang ds.w 1 ; cur language for script
- itlbNumRep ds.b 1 ; number representation code
- itlbDateRep ds.b 1 ; date representation code
- itlbKeys ds.w 1 ; KCHR id number.
- itlbIcon ds.w 1 ; SICN id number.
- itlbSize equ * ; size of bundle.
- endr
-
- ; itl2 routine vector offsets.
-
- initHook EQU 0
- fetchHook EQU 2
- vernierHook EQU 4
- projectHook EQU 6
- rsvdHook EQU 8
- exitHook EQU 10
-
- ; Note that the value of itl2FlagsOffset is equal
- ; to the value of rsvdHook. In the old itl2
- ; format the value at this location
- ; was an unused routine offset. In the new itl2
- ; format, the value at this location is a flag
- ; ($ffff) indicating the new format.
-
- itl2FlagsOffset EQU 8
- itl2VersionOffset EQU 28
-
- ; itl2 table offsets
-
- typeListOffset EQU 12
- classArrayOffset EQU 14
- upperListOffset EQU 16
- lowerListOffset EQU 18
- upperNoMarkListOffset EQU 20
- wordTableOffset EQU 22
- wrapTableOffset EQU 24
- noMarkListOffset EQU 26
-
- ; String data structure for itl2 stack frames.
-
- IUStrData record 0
- curChar ds.w 1 ; current character.
- mapChar ds.w 1 ; projected character.
- decChar ds.w 1 ; decision char for weak equality.
- bufChar ds.b 1 ; buffer for expansion.
- justAfter ds.b 1 ; boolean for AE vs ligature-AE.
- ignChar ds.b 1 ; flag: ignore char.
- noFetch ds.b 1 ; flag: no fetch of next.
- strCnt ds.w 1 ; length word.
- strPtr ds.l 1 ; current ptr to string.
- endr
-
- ; Stack frame for itl2 routines.
-
- IUSortFrame record {oldA6},decrement
- result ds.w 1
- aStrText ds.l 1
- bStrText ds.l 1
- aStrLen ds.w 1
- bStrLen ds.w 1
- return ds.l 1
- oldA6 ds.l 1
- aInfo ds IUStrData
- bInfo ds IUStrData
- wantMag ds.b 1 ; 1-MagStrig 0-MagIdString.
- weakEq ds.b 1 ; Signals at most weak equality.
- msLock ds.b 1 ; high byte of master ptr.
- weakMag ds.b 1 ; -1 weak compare, 1 strong compare.
- supStorage ds.b 18 ; extra storage.
- weakAPtr ds.l 1 ; sup. pointer
- weakBPtr ds.l 1 ; sup. pointer
- lkSize equ * ; frame size.
- paramBytes equ aStrText-return
- endr
-
- LongDateRec record 0 ; zero any fields not used!
- era ds.w 1
- year ds.w 1
- month ds.w 1
- day ds.w 1
- hour ds.w 1
- minute ds.w 1
- second ds.w 1
- dayOfWeek ds.w 1
- dayOfYear ds.w 1
- weekOfYear ds.w 1
- pm ds.w 1
- ldReserved ds.w 3
- LongDateRecSize equ *
- endR
-
- LongDateTime record 0 ; record for comp type
- highLong ds.l 1
- lowLong ds.l 1
- endR
-
- ; date equates constants
-
- LongDateField record 0 ;DateField: enum type
- eraField ds.b 1
- yearField ds.b 1
- monthField ds.b 1
- dayField ds.b 1
- hourField ds.b 1
- minuteField ds.b 1
- secondField ds.b 1
- dayOfWeekField ds.b 1
- dayOfYearField ds.b 1
- weekOfYearField ds.b 1
- pmField ds.b 1
- res1Field ds.b 1
- res2Field ds.b 1
- res3Field ds.b 1
-
- maxDateField equ pmField ; currently largest used field
-
- eraMask equ 1<<eraField
- yearMask equ 1<<yearField
- monthMask equ 1<<monthField
- dayMask equ 1<<dayField
- hourMask equ 1<<hourField
- minuteMask equ 1<<minuteField
- secondMask equ 1<<secondField
- dayOfWeekMask equ 1<<dayOfWeekField
- dayOfYearMask equ 1<<dayOfYearField
- weekOfYearMask equ 1<<weekOfYearField
- pmMask equ 1<<pmField
-
- dateStdMask equ eraMask++yearMask++monthMask++dayMask++hourMask++minuteMask++secondMask
- endR
-
- smallDateBit EQU 31 ; Restrict valid date/time to range of Time global
- togChar12HourBit EQU 30 ; If toggling hour by char, accept hours 1..12 only
- togCharZCycleBit EQU 29 ; Modifier for togChar12HourBit: accept hours 0..11 only
- togDelta12HourBit EQU 28 ; If toggling hour up/down, restrict to 12-hour range (am/pm)
- genCdevRangeBit EQU 27 ; Restrict date/time to range used by genl CDEV
- validDateFields EQU -1
-
-
- TogglePB record 0
- togFlags: ds.l 1 ; longint; {caller normally sets low word to dateStdMask = $7F}
- amChars: ds.l 1 ; resType; {from intl0, but uppercased}
- pmChars: ds.l 1 ; ResType; {ditto}
- reserved: ds.l 4 ; array [0..3] of Longint;
- endR
-
- ToggleResults record 0
- toggleUndefined ds.b 1
- toggleOk ds.b 1
- toggleBadField ds.b 1
- toggleBadDelta ds.b 1
- toggleBadChar ds.b 1
- toggleUnknown ds.b 1
- toggleBadNum ds.b 1 ;{can't use char as number}
- toggleOutOfRange EQU * ;{synonym for toggleErr3}
- toggleErr3 ds.b 1 ;{reserved}
- toggleErr4 ds.b 1 ;{reserved}
- toggleErr5 ds.b 1 ;{reserved}
- endR
-
- MachineLocation record 0
- latitude ds.l 1 ;fract
- longitude ds.l 1 ;fract
- dlsDelta ds.b 1 ;signed byte
- gmtDelta ds.b 3 ;3 byte signed integer
- endR
-
-
-
- ; String2Date status values
-
- fatalDateTime EQU $8000 ; String2Date and String2Time mask to a fatal error
- longDateFound EQU 1 ; String2Date mask to long date found
- leftOverChars EQU 2 ; String2Date & Time mask to warn of left over characters
- sepNotIntlSep EQU 4 ; String2Date & Time mask to warn of non standard separators
- fieldOrderNotIntl EQU 8 ; String2Date & Time mask to warn of non standard field order
- extraneousStrings EQU 16 ; String2Date & Time mask to warn of unparsable strings in text
- tooManySeps EQU 32 ; String2Date & Time mask to warn of too many separators
- sepNotConsistent EQU 64 ; String2Date & Time mask to warn of inconsistent separators
- tokenErr EQU $8100 ; String2Date & Time mask to say that tokenizer err encountered
- cantReadUtilities EQU $8200
- dateTimeNotFound EQU $8400 ; String2Date mask to say that date was not found
- dateTimeInvalid EQU $8800 ; Invalid time/date e.g. 13:61PM
-
- DateOrders RECORD 0,INCREMENT
- mdy DS.B 1
- dmy DS.B 1
- ymd DS.B 1
- myd DS.B 1
- dym DS.B 1
- ydm DS.B 1
- ENDR
-
- ; TokenType values
-
- tokenIntl EQU 4 ; the itl resource number of the tokenizer
- tokenEmpty EQU -1
- tokenUnknown EQU 0
- tokenWhite EQU 1
- tokenLeftLit EQU 2
- tokenRightLit EQU 3
- tokenAlpha EQU 4
- tokenNumeric EQU 5
- tokenNewLine EQU 6
- tokenLeftComment EQU 7
- tokenRightComment EQU 8
- tokenLiteral EQU 9
- tokenEscape EQU 10
- tokenAltNum EQU 11
- tokenRealNum EQU 12
- tokenAltReal EQU 13
- tokenReserve1 EQU 14
- tokenReserve2 EQU 15
- tokenLeftParen EQU 16
- tokenRightParen EQU 17
- tokenLeftBracket EQU 18
- tokenRightBracket EQU 19
- tokenLeftCurly EQU 20
- tokenRightCurly EQU 21
- tokenLeftEnclose EQU 22
- tokenRightEnclose EQU 23
- tokenPlus EQU 24
- tokenMinus EQU 25
- tokenAsterisk EQU 26
- tokenDivide EQU 27
- tokenPlusMinus EQU 28
- tokenSlash EQU 29
- tokenBackSlash EQU 30
- tokenLess EQU 31
- tokenGreat EQU 32
- tokenEqual EQU 33
- tokenLessEqual2 EQU 34
- tokenLessEqual1 EQU 35
- tokenGreatEqual2 EQU 36
- tokenGreatEqual1 EQU 37
- token2Equal EQU 38
- tokenColonEqual EQU 39
- tokenNotEqual EQU 40
- tokenLessGreat EQU 41
- tokenExclamEqual EQU 42
- tokenExclam EQU 43
- tokenTilda EQU 44
- tokenComma EQU 45
- tokenPeriod EQU 46
- tokenLeft2Quote EQU 47
- tokenRight2Quote EQU 48
- tokenLeft1Quote EQU 49
- tokenRight1Quote EQU 50
- token2Quote EQU 51
- token1Quote EQU 52
- tokenSemicolon EQU 53
- tokenPercent EQU 54
- tokenCarat EQU 55
- tokenUnderline EQU 56
- tokenAmpersand EQU 57
- tokenAtSign EQU 58
- tokenBar EQU 59
- tokenQuestion EQU 60
- tokenPi EQU 61
- tokenRoot EQU 62
- tokenSigma EQU 63
- tokenIntegral EQU 64
- tokenMicro EQU 65
- tokenCapPi EQU 66
- tokenInfinity EQU 67
- tokenColon EQU 68
- tokenHash EQU 69
- tokenDollar EQU 70
- tokenNoBreakSpace EQU 71
- tokenFraction EQU 72
- tokenIntlCurrency EQU 73
- tokenLeftSingGuillemet EQU 74
- toeknRightSingGuillemet EQU 75
- tokenPerThousand EQU 76
- tokenNil EQU 127
- delimPad EQU -2
-
- TokenResults record 0
- tokenOK ds.b 1
- tokenOverflow ds.b 1
- stringOverflow ds.b 1
- badDelim ds.b 1
- badEnding ds.b 1
- crash ds.b 1
- endr
-
- TokenBlock RECORD 0,INCR
- source ds.l 1
- sourceLength ds.l 1
- tokenList ds.l 1
- tokenLength ds.l 1
- tokenCount ds.l 1
- stringList ds.l 1
- stringLength ds.l 1
- stringCount ds.l 1
- doString ds.b 1
- doAppend ds.b 1
- doAlphanumeric ds.b 1
- doNest ds.b 1
- leftDelims ds.w 2
- rightDelims ds.w 2
- leftComment ds.l 2
- rightComment ds.l 2
- escapeCode ds.w 1
- decimalCode ds.w 1
- itlResource ds.l 1
- reserved ds.l 8 ;must be zero!
- ENDR
-
- TokenRec RECORD 0,INCR
- theToken ds.w 1
- position ds.l 1
- length ds.l 1
- stringPosition ds.l 1
- tokenRecSize equ *
- ENDR
-
- UntokenTable Record 0, INCR
- len ds.w 1
- lastToken ds.w 1
- index ds.w 256 ;index table; last = lastToken
- ;list of pascal strings here. index pointers are from front of table
- Endr
-
- ; Trap routine selectors: script manager 1.0
-
-
- smFontScript EQU 0
- smIntlScript EQU 2
- smKybdScript EQU 4
- smFont2Script EQU 6
- smGetEnvirons EQU 8
- smSetEnvirons EQU 10
- smGetScript EQU 12
- smSetScript EQU 14
- smHighCall EQU smSetScript ; boundry between script mgr & script systems calls
- smCharByte EQU 16
- smCharType EQU 18
- smPixel2Char EQU 20
- smChar2Pixel EQU 22
- smTranslit EQU 24
- smFindWord EQU 26
- smHiliteText EQU 28
- smDrawJust EQU 30
- smMeasureJust EQU 32
- smParseTable EQU 34
-
- ; Full Trap routine selectors: script manager 1.0
-
- smSelFontScript EQU (1<<31)++($0200<<16)++smFontScript
- smSelIntlScript EQU (1<<31)++($0200<<16)++smIntlScript
- smSelKybdScript EQU (1<<31)++($0002<<16)++smKybdScript
- smSelFont2Script EQU (1<<31)++($0202<<16)++smFont2Script
- smSelGetEnvirons EQU (1<<31)++($0402<<16)++smGetEnvirons
- smSelSetEnvirons EQU (1<<31)++($0206<<16)++smSetEnvirons
- smSelGetScript EQU (1<<31)++($0404<<16)++smGetScript
- smSelSetScript EQU (1<<31)++($0208<<16)++smSetScript
- smSelCharType EQU (1<<31)++($0206<<16)++smCharType
- smSelCharByte EQU (1<<31)++($0206<<16)++smCharByte
- smSelPixel2Char EQU (1<<31)++($020E<<16)++smPixel2Char
- smSelChar2Pixel EQU (1<<31)++($020C<<16)++smChar2Pixel
- smSelTranslit EQU (1<<31)++($020E<<16)++smTranslit
- smSelFindWord EQU (1<<31)++($0012<<16)++smFindWord
- smSelHiliteText EQU (1<<31)++($000E<<16)++smHiliteText
- smSelDrawJust EQU (1<<31)++($0008<<16)++smDrawJust
- smSelMeasureJust EQU (1<<31)++($000C<<16)++smMeasureJust
- smSelParseTable EQU (1<<31)++($0204<<16)++smParseTable
-
- ; Trap routine macros.
-
- macro
- _FontScript
- move.l #smSelFontScript,-(sp)
- _ScriptUtil
- endm
-
- macro
- _IntlScript
- move.l #smSelIntlScript,-(sp)
- _ScriptUtil
- endm
-
- macro
- _KeyScript
- move.l #smSelKybdScript,-(sp)
- _ScriptUtil
- endm
-
- macro
- _Font2Script
- move.l #smSelFont2Script,-(sp)
- _ScriptUtil
- endm
-
- macro
- _GetEnvirons
- move.l #smSelGetEnvirons,-(sp)
- _ScriptUtil
- endm
-
- macro
- _SetEnvirons
- move.l #smSelSetEnvirons,-(sp)
- _ScriptUtil
- endm
-
- macro
- _GetScript
- move.l #smSelGetScript,-(sp)
- _ScriptUtil
- endm
-
- macro
- _SetScript
- move.l #smSelSetScript,-(sp)
- _ScriptUtil
- endm
-
- macro
- _CharByte
- move.l #smSelCharByte,-(sp)
- _ScriptUtil
- endm
-
- macro
- _CharType
- move.l #smSelCharType,-(sp)
- _ScriptUtil
- endm
-
- macro
- _Pixel2Char
- move.l #smSelPixel2Char,-(sp)
- _ScriptUtil
- endm
-
- macro
- _Char2Pixel
- move.l #smSelChar2Pixel,-(sp)
- _ScriptUtil
- endm
-
- macro
- _Transliterate
- move.l #smSelTranslit,-(sp)
- _ScriptUtil
- endm
-
- macro
- _FindWord
- move.l #smSelFindWord,-(sp)
- _ScriptUtil
- endm
-
- macro
- _HiliteText
- move.l #smSelHiliteText,-(sp)
- _ScriptUtil
- endm
-
- macro
- _DrawJust
- move.l #smSelDrawJust,-(sp)
- _ScriptUtil
- endm
-
- macro
- _MeasureJust
- move.l #smSelMeasureJust,-(sp)
- _ScriptUtil
- endm
-
- macro
- _ParseTable
- move.l #smSelParseTable,-(sp)
- _ScriptUtil
- endm
-
- ; -----------------------------------------------------------------------------
- ; Macros for the Script Manager trap call: Version 1.1
- ; -----------------------------------------------------------------------------
-
- Macro
- DefSMgrRoutine &name,&selector,&argSize,&returnSize
- sm&name: equ &selector**$FFFF
- smSel&name: equ (1<<31)++(&returnSize<<24)++(&argSize<<16)++sm&name
- endm
-
- ; general script manager routines
-
- DefSmgrRoutine StyledLineBreak, -2,28,2
- DefSmgrRoutine GetFormatOrder, -4,18,0
- DefSmgrRoutine IntlTokenize, -6,4,2
-
- DefSmgrRoutine InitDateCache, -8,4,2
- DefSmgrRoutine String2Date, -10,20,2
- DefSmgrRoutine String2Time, -12,20,2
-
- DefSmgrRoutine LongDate2Secs, -14,8,0
- DefSmgrRoutine LongSecs2Date, -16,8,0
- DefSmgrRoutine ToggleDate, -18,14,2
-
- DefSmgrRoutine Str2Format, -20,12,2
- DefSmgrRoutine Format2Str, -22,16,2
- DefSmgrRoutine FormatX2Str, -24,16,2
- DefSmgrRoutine FormatStr2X, -26,16,2
- DefSmgrRoutine ValidDate, -28,12,2
-
- smLowCall EQU smValidDate ; lowest script manager routine
-
- ; FormatClass enumeration
-
- fPositive EQU 0
- fNegative EQU 1
- fZero EQU 2
-
- ; FormatResultType enumeration
-
- fFormatOK EQU 0
- fBestGuess EQU 1
- fOutOfSynch EQU 2
- fSpuriousChars EQU 3
- fMissingDelimiter EQU 4
- fExtraDecimal EQU 5
- fMissingLiteral EQU 6
- fExtraExp EQU 7
- fFormatOverflow EQU 8
- fFormStrIsNAN EQU 9
- fBadPartsTable EQU 10
- fExtraPercent EQU 11
- fExtraSeparator EQU 12
- fEmptyFormatString EQU 13
-
- WideChar record 0,increment
- a ds.b 2 ; PACKED ARRAY[0..1] OF CHAR
- ORG a
- b ds.w 1 ; INTEGER
- endr
-
- WideCharArr record 0,increment
- size ds.w 1 ; INTEGER
- data ds.w 10 ; PACKED ARRAY[0..9] OF WideChar
- endr
-
- fVNumber EQU 0 ; first version of NumFormatString
-
- NumFormatString record 0,increment
- fLength ds.b 1 ; length of format String
- fVersion ds.b 1 ; version number
- data ds.b 254 ; private data (see nScriptEqu.priv)
- endr
-
-
- Itl4Rec record 0,increment
- flags ds.w 1
- resourceType ds.l 1
- resourceNum ds.w 1
- version ds.w 1
- resHeader1 ds.l 1
- resHeader2 ds.l 1
- numTables ds.w 1 ; one-based.
- mapOffset ds.l 1 ; offsets are from record start
- strOffset ds.l 1
- fetchOffset ds.l 1
- unTokenOffset ds.l 1
- defPartsOffset ds.l 1
- resOffset6 ds.l 1
- resOffset7 ds.l 1
- resOffset8 ds.l 1
- itl4HeaderSize equ *
- ; the rest is data pointed to by offsets.
- endr
-
- ;Number format equates
-
- tokLeftQuote EQU 1
- tokRightQuote EQU 2
- tokLeadPlacer EQU 3
- tokLeader EQU 4
- tokNonLeader EQU 5
- tokZeroLead EQU 6
- tokPercent EQU 7
- tokPlusSign EQU 8
- tokMinusSign EQU 9
- tokThousands EQU 10
- tokSeparator EQU 12 ; 11 is reserved
- tokEscape EQU 13
- tokDecPoint EQU 14
- tokEPlus EQU 15
- tokEMinus EQU 16
- tokMaxSymbols EQU 31
-
- NumberParts record 0,increment
- version ds.w 1 ; integer
- data ds.w tokMaxSymbols ; ARRAY[tokLeftQuote..tokMaxSymbols] OF WideChar
- pePlus ds WideCharArr ; 64
- peMinus ds WideCharArr ; 86
- peMinusPlus ds WideCharArr ; 108
- altNumTable ds WideCharArr ; 130
- reserved ds.b 20
- numberPartsSize equ *
- curNumberPartsVersion equ 1
- endr
-
-
- FVector record 0,increment
- start ds.w 1 ; INTEGER
- length ds.w 1 ; INTEGER
- endr
-
- TripleInt record 0,increment
- zzz1 ds FVector
- zzz2 ds FVector
- zzz3 ds FVector
- endr
-
- ScriptRunStatus record 0,increment
- script ds.b 1
- variant ds.b 1
- endr
-
- ;------------------------------------------------------------------------------
-
- ; script-specific routines
-
- DefSmgrRoutine PortionText, 36,8,4
- DefSmgrRoutine FindScriptRun, 38,12,2
- DefSmgrRoutine VisibleLength, 40,8,4
- sisHighCall EQU smVisibleLength ; highest script routine
- DefSmgrRoutine IsSpecialFont, 42,2,2
- DefSmgrRoutine RawPrinterValues, 44,22,2
- fisHighCall EQU smRawPrinterValues ; highest FIS script routine
-
- ;------------------------------------------------------------------------------
- ; Trap routine macros: script manager 2.0
-
- macro
- _GetFormatOrder
- move.l #smSelGetFormatOrder,-(sp)
- _ScriptUtil
- endm
-
- macro
- _StyledLineBreak
- move.l #smSelStyledLineBreak,-(sp)
- _ScriptUtil
- endm
-
- macro
- _IntlTokenize
- move.l #smSelIntlTokenize,-(sp)
- _ScriptUtil
- endm
-
- macro
- _InitDateCache
- move.l #smSelInitDateCache,-(sp)
- _ScriptUtil
- endm
-
- macro
- _String2Date
- move.l #smSelString2Date,-(sp)
- _ScriptUtil
- endm
-
- macro
- _String2Time
- move.l #smSelString2Time,-(sp)
- _ScriptUtil
- endm
-
- macro
- _LongSecs2Date
- move.l #smSelLongSecs2Date,-(sp)
- _ScriptUtil
- endm
-
- macro
- _LongDate2Secs
- move.l #smSelLongDate2Secs,-(sp)
- _ScriptUtil
- endm
-
- macro
- _Str2Format
- move.l #smSelStr2Format,-(sp)
- _ScriptUtil
- endm
-
- macro
- _Format2Str
- move.l #smSelFormat2Str,-(sp)
- _ScriptUtil
- endm
-
- macro
- _FormatX2Str
- move.l #smSelFormatX2Str,-(sp)
- _ScriptUtil
- endm
-
- macro
- _FormatStr2X
- move.l #smSelFormatStr2X,-(sp)
- _ScriptUtil
- endm
-
- macro
- _ValidDate
- move.l #smSelValidDate,-(sp)
- _ScriptUtil
- endm
-
- macro
- _ToggleDate
- move.l #smSelToggleDate,-(sp)
- _ScriptUtil
- endm
-
- macro
- _PortionText
- move.l #smSelPortionText,-(sp)
- _ScriptUtil
- endm
-
- macro
- _FindScriptRun
- move.l #smSelFindScriptRun,-(sp)
- _ScriptUtil
- endm
-
- macro
- _ReadLocation
- movea.l (sp)+,A0
- move.l #$000C00E4,D0
- _ReadXPRam
- endm
-
- macro
- _WriteLocation
- movea.l (sp)+,A0
- move.l #$000C00E4,D0
- _WriteXPRam
- endm
-
- macro
- _VisibleLength
- move.l #smSelVisibleLength,-(sp)
- _ScriptUtil
- endm
-
- macro
- _IsSpecialFont
- move.l #smSelIsSpecialFont,-(sp)
- _ScriptUtil
- endm
-
- macro
- _RawPrinterValues
- move.l #smSelRawPrinterValues,-(sp)
- _ScriptUtil
- endm
-
-